/*
	This file is part of the JKTest
    Copyright (C) 2008 Royce Y. Feng <ryfeng@gmail.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package jktest;

import javax.swing.JPanel;
import java.awt.GridLayout;

/**
 * 
 * The pseudo panel class that will be extended. Contains all the necessary 
 * functions for a fully working test panel (besides the ones that run the test 
 * and such).
 * 
 * @author Royce Feng
 */

public abstract class JKMainPanel extends JPanel {
    
    private JKMainGui parent;
    
    /**
     * 
     * Constructor with a GridLayout. Shouldn't be used that much...
     * 
     * @param gl The gridlayout parameter
     * @param _parent The main GUI
     */
    public JKMainPanel( GridLayout gl, JKMainGui _parent ) {
        super(gl);
        parent = _parent;
    }
    
    /**
     * 
     * Constructor accepting a parent class
     * 
     * @param _parent The main GUI
     */
    public JKMainPanel( JKMainGui _parent ) {
        super();
        parent = _parent;
    }
    
    /**
     * 
     * Constructor
     * 
     */
    public JKMainPanel() {
        super();
    }
    
    /**
     * 
     * Gets the parent class. Safer to use that changing the parent class to 
     * public...
     * 
     * @return The parent class
     */
    public JKMainGui getThisParent() {
        return parent;
    }
    
    /**
     * 
     * Abstract method that definitely needs to be extended for any test panel...
     * 
     * @param source The source from a JKButton
     */
    public abstract void ButtonClicked( String source );
    
}
